package com.zmn.uac.api.config;

import com.zmn.uac.api.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;


/**
 * 类描述：
 *
 * @author xujie
 * @since 2021/06/09 18:15
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    @Resource
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        InterceptorRegistration headerInterceptorRegistration = registry.addInterceptor(loginInterceptor);
        headerInterceptorRegistration.addPathPatterns("/bind/**");
        headerInterceptorRegistration.addPathPatterns("/userInfo/**");
    }
}
